package cn.codeforfun.controller;

import cn.codeforfun.util.PropUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * Created by P0061449 on 2017/2/7.
 */
@Controller
public class IndexController {
    private final Logger log = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private PropUtils propUtils;

    @RequestMapping
    @ResponseBody
    public String index() {
        log.debug("debug...");
        log.info("info...");
        System.out.println(propUtils.getAppId());
        return "hello, world";
    }

    @RequestMapping("/errortest")
    @ResponseBody
    public String error() {
        int i = 1 / 0;
        return "";
    }
}
